﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TntOrm.Attributes
{
    [AttributeUsage( AttributeTargets.Property )]
    public class OrmTableField : Attribute
    {
        private string _Default;

        public string DefaultValue
        {
            get { return _Default; }
            set { _Default = value; }
        }

        
        private string  _FieldName;

        public string  FieldName
        { 
            get { return _FieldName; }
            set { _FieldName = value; }
        }

        private System.Data.SqlDbType? _Type;

        public System.Data.SqlDbType? Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        private int? _Length;

        public int? Length
        {
            get { return _Length; }
            set { _Length = value; }
        }

        private bool _IsNullAble;

        public bool IsNullAble
        {
            get { return _IsNullAble; }
            set { _IsNullAble = value; }
        }

        public OrmTableField( string Name )
        {
            this._FieldName = Name;
            this._IsNullAble = false;
        }

        public OrmTableField( string Name, bool IsNullAble )
        {
            this._FieldName = Name;
            this._IsNullAble = IsNullAble;
        }

        public OrmTableField( string Name, System.Data.SqlDbType FieldType )
        {
            this._FieldName = Name;
            this._Type = FieldType;
            this._IsNullAble = false;
        }

        public OrmTableField( string Name, System.Data.SqlDbType FieldType, bool IsNullAble )
        {
            this._FieldName = Name;
            this._Type = FieldType;
            this._IsNullAble = IsNullAble;
        }

        public OrmTableField( string Name, System.Data.SqlDbType FieldType, int FieldLength )
        {
            this._FieldName = Name;
            this._Type = FieldType;
            this._Length = FieldLength;
            this._IsNullAble = false;
        }

        public OrmTableField( string Name, System.Data.SqlDbType FieldType, int FieldLength, bool IsNullAble )
        {
            this._FieldName = Name;
            this._Type = FieldType;
            this._Length = FieldLength;
            this._IsNullAble = IsNullAble;
        }

        public OrmTableField( string Name, System.Data.SqlDbType FieldType, int FieldLength, bool IsNullAble, string Default )
        {
            this._FieldName = Name;
            this._Type = FieldType;
            this._Length = FieldLength;
            this._IsNullAble = IsNullAble;
            this._Default = Default;
        }
    }
}